$(".inf").click(function (){
    $.ajax({
        type:"get",
        url:"/Orders/getOrderInf",
        dataType:"json",
        contextType:"application/json;charset=UTF-8",
        data:'orderId='+$(this).parents('tr').children('#thisOrderId').text(),
        success:function (result){
            console.log(result);
            var date = result[0].orderDate;
            var dateee = new Date(date).toJSON();
            var date1 = new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
            date1+='.0';
            console.log(date1);
            for(var i=0;i<result.length;i++){
                $("#orderId").val(result[i].orderId);
                $("#userid").val(result[i].username);
                $("#orderDate").val(date1);
                $("#shipAddress1").val(result[i].shipAddress1);
                $("#shipAddress2").val(result[i].shipAddress1);
                $("#shipCity").val(result[i].shipCity);
                $("#shipState").val(result[i].shipState);
                $("#shipZip").val(result[i].shipZip);
                $("#shipCountry").val(result[i].shipCountry);
                $("#billAddress1").val(result[i].billAddress1);
                $("#billAddress2").val(result[i].billAddress2);
                $("#billCity").val(result[i].billCity);
                $("#billState").val(result[i].billState);
                $("#billZip").val(result[i].billZip);
                $("#billCountry").val(result[i].billCountry);
                $("#courier").val(result[i].courier);
                $("#creditCard").val(result[i].creditCard);
                $("#expiryDate").val(result[i].expiryDate);
                $("#totalPrice").val(result[i].totalPrice)
                $("#shipToFirstName").val(result[i].shipToFirstName);
                $("#shipToLastName").val(result[i].shipToLastName);
                $("#billToFirstName").val(result[i].billToFirstName);
                $("#billToLastName").val(result[i].billToLastName);
                $("#cardType").val(result[i].cardType);
                $("#locale").val(result[i].locale);
                $("#status").val(result[i].status);
            }
        }
    })
})


function showPopup() {
    document.getElementById("overlay").style.display = "block";
    document.getElementById("popup").style.display = "block";
}

function hidePopup() {
    document.getElementById("overlay").style.display = "none";
    document.getElementById("popup").style.display = "none";
}